package com.liu.mq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    /**
     * 监听错误日志队列
     * @param message
     */
    @RabbitListener(queues = {"error-log"})
    public void handlerError(Message message){
        System.out.println("错误日志"+new String(message.getBody()));
    }
    /**
     * 监听基本信息日志队列
     * @param message
     */
    @RabbitListener(queues = {"info-log"})
    public void handlerInfo(Message message){
        System.out.println("信息日志"+new String(message.getBody()));
    }

    /**
     * 监听订单日志信息
     * @param message
     */
    @RabbitListener(queues = {"order-log"})
    public void handlerOrder(Message message){
        System.out.println("订单日志"+new String(message.getBody()));
    }


}
